package io;

import java.io.*;

/**
 * @author haomin
 * @date 2022/06/07 11:38
 **/

public class CopyPng {
    public static void main(String[] args) throws IOException {
        try (InputStream is = new FileInputStream("D:\\电影\\文件操作\\src.png")){
            try(OutputStream os = new FileOutputStream("D:\\电影\\文件操作\\dest2.png")){
                byte[] bur = new byte[1024];
                int num;
                while (true){
                    num = is.read(bur);
                    if(num == -1){
                         break;
                    }
                    os.write(bur,0,num);
                }
                os.flush();
            }

        }
    }
}